package gspushmq.v1.app.subscribeapp.enumeration;
/**
 *
 * @Description 推送平台枚举
 * @Author chengsj
 * @Version 1.0
 *
 */
public enum PlatformEnum {
    ALIYUN(9001,"阿里云移动推送"),
    WS(9000,"内部websocket推送");

    int code ;
    String name;

    PlatformEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByCode(Integer code){
        if ( code == null)
            return null;
        for (PlatformEnum p : PlatformEnum.values())
            if (p.getCode() == code)
                return p.getName();

        return null;
    }
}
